package smartcarpool.ui;

import android.app.PendingIntent;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.View;


public class SCCollectionPagerAdapter extends FragmentPagerAdapter {

	private FragmentManager fragmentManager;
    private PendingIntent pendingIntent;
	
	public SCCollectionPagerAdapter(FragmentManager fm, PendingIntent pendingIntent) {
		super(fm);
		this.fragmentManager = fm;
        this.pendingIntent = pendingIntent;
		// TODO Auto-generated constructor stub
	}

	@Override
	public Fragment getItem(int fragment_i) {
		Fragment fragment = null;
		if (fragment_i == 0){
			fragment = new tab1_Fragment();
			//fragmentManager.beginTransaction().add(fragment, "TAB1");
			//fragment = fragmentManager.findFragmentByTag("TAB1");
		} else {
			fragment = new tab2_Fragment(pendingIntent);

			//fragment = fragmentManager.findFragmentByTag("TAB1");
		}
		return fragment;
	}

	@Override
	public int getCount() {
		return 2;
	}

/*	private static String makeFragmentName(int viewId, int index)
	{
	     return "android:switcher:" + viewId + ":" + index;
	}*/
}

